\ProvidesPackage{styles/packages}

% Productivity
\usepackage{pdfpages} % Insert PDF pages
\usepackage{subfiles} % Adopt a modular structure
\usepackage{todonotes} % Add useful notes in the margins

% Listings code
\usepackage{listings} % Code
%\usepackage{minted}
\usepackage{scrhack} % Work around compatibility problem

\definecolor{listingkeywords}{rgb}{0.0, 0.5, 0.0}
\definecolor{listingidentifiers}{rgb}{0, 0, 0}
\definecolor{listingcomments}{rgb}{0.25, 0.5, 0.5}
\definecolor{listingstrings}{rgb}{0.73, 0.13, 0.13}
\definecolor{listingnumbers}{rgb}{0.25, 0.25, 0.25}
\lstdefinestyle{kaolst}{
	aboveskip=0.7\topskip,
	belowskip=-0.05\topskip,
	basicstyle=\small\ttfamily,
	commentstyle=\color{listingcomments}\itshape,
	keywordstyle=\color{listingkeywords}\bfseries,
	numberstyle=\scriptsize\color{listingnumbers}\ttfamily,
	stringstyle=\color{listingstrings},
	identifierstyle=\color{listingidentifiers},
	backgroundcolor=\color{White},
	breakatwhitespace=false,
	breaklines=true,
	captionpos=t,
	keepspaces=true,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	numbers=left,
	numbersep=1em,
	%frame=lines,
	frame=l,
	framerule=.7pt,
	tabsize=4,
	defaultdialect=[LaTeX]Tex,
}
\lstdefinestyle{kaolstplain}{
	aboveskip=0.6\topskip,
	belowskip=-0.1\topskip,
	basicstyle=\small\ttfamily,
	commentstyle=\color{listingcomments}\itshape,
	keywordstyle=\color{listingkeywords}\bfseries,
	numberstyle=\scriptsize\color{listingnumbers}\ttfamily,
	stringstyle=\color{listingstrings},
	identifierstyle=\color{listingidentifiers},
	backgroundcolor=\color{White},
	breakatwhitespace=false,
	breaklines=true,
	captionpos=b,
	keepspaces=true,
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	numbers=none,
	frame=none,
	tabsize=4,
	defaultdialect=[LaTeX]Tex,
}
\lstset{style=kaolst}

% Verbatim
%\usepackage{fancyvrb} % Customization of verbatim environments
%\fvset{fontsize=\normalsize} % Change here the font size of all 
%verbatim \preto{\@verbatim}{\topsep=0pt \partopsep=0pt }

% Algorithms
\usepackage[linesnumbered, ruled, vlined]{algorithm2e} % Algorithms

% Special gliphs
\usepackage{ccicons} % Creative Commons icons
\usepackage{metalogo} % XeTeX logo

% Index, glossary and nomenclature
\usepackage{imakeidx}
\usepackage[xindy,toc]{glossaries}
\usepackage[intoc]{nomencl}

% Commands to print specific wors always in the same way
% TODO: in \Command, automatically escape braces {} and replace backslashes with \textbackslash
\newcommand{\Class}[1]{\texttt{#1}}
\newcommand{\Package}[1]{\texttt{#1}}
\newcommand{\Option}[1]{\texttt{#1}}
\newcommand{\Command}[1]{\texttt{\textbackslash#1}}
\newcommand{\Environment}[1]{\texttt{#1}}
\newcommand{\Path}[1]{\texttt{#1}}

% Print latin words in italics (The xspace package is required but we already loaded it in the class)
\newcommand{\hairsp}{\hspace{1pt}} % Command to print a very short space
\newcommand{\invitro}{\textit{in vitro}\xspace}
\newcommand{\invivo}{\textit{in vivo}\xspace}
\newcommand{\cis}{\textit{cis}\xspace}
\newcommand{\trans}{\textit{trans}\xspace}
\newcommand{\etal}{\textit{et al.}\xspace}
\newcommand{\denovo}{\textit{de novo}\xspace}
\newcommand{\adhoc}{\textit{ad hoc}\xspace}
\newcommand{\etcetera}{\textit{et cetera}\xspace}
\newcommand{\etc}{\textit{etc.}\xspace}
\newcommand{\ie}{\textit{i.\nobreak\hairsp{}e.}\xspace}
\newcommand{\eg}{\textit{e.\nobreak\hairsp{}g.}\xspace}
\newcommand{\vs}{\textit{vs}\xspace}
\newcommand{\cfr}{\textit{cfr.}\xspace}

% Tables
\newcommand{\na}{\quad--} % Used in tables for N/A cells
\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}} % Create parentheses around text in tables which take up no horizontal space - this improves column spacing
\newcommand{\hangstar}{\makebox[0pt][l]{*}} % Create asterisks in tables which take up no horizontal space - this improves column spacing

% A command to print the current month and year (from tufte-latex)
\newcommand{\monthyear}{\ifcase\month\or January\or February\or March\or 
April\or May\or June\or July\or August\or September\or October\or 
November\or December\fi\space\number\year}
